package com.xdf.xzymanagementsystem.util;

import com.xdf.xzymanagementsystem.dao.CallProcedureMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author chanchaw
 * @create 2022-08-18 16:27
 */
@Component
@Configuration
@EnableScheduling
public class Schedule {
    @Autowired
    private CallProcedureMapper callProcedureMapper;
    @Autowired
    private CcThreadPool ccThreadPool;

    // 删除质检表中重复的数据。每天中午12:17:1,晚上23:17:1执行
    @Scheduled(cron = "1 47 12,23 * * ?")
    private void deleteDuplicateQualifier(){
        ccThreadPool.execute(()->{
            callProcedureMapper.delDuplicateQualifier();
        });

    }
}
